// Block.h: interface for the CBlock class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BLOCK_H__803DC079_B3EE_47D6_9AF1_83C8A059332C__INCLUDED_)
#define AFX_BLOCK_H__803DC079_B3EE_47D6_9AF1_83C8A059332C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CBlock  
{
	char m_elements[17] ;
	UINT m_size;
	int m_colorIndex,m_shapeIndex;
    COLORREF m_color;
	int m_X,m_Y;
	
public:
	void SetElem(char *pElem);
	void Display(CDC &DC,int x,int y);
	static CSize m_Offset;
	static void SetOffset(int x,int y);
	void SetPosition(CPoint point);
	void Right(CDC&dc);
	void Left(CDC&dc);
	CPoint GetPosition();
	int GetSize();
	void Descend(CDC &dc);
	void Ascend(CDC &dc);
	bool HitTest(int *pBoard,int x,int y);
	static UINT BLOCK_SIZE;
	void Draw(CDC&DC);
 	void operator=(CBlock&block)
	{
 	 Init(block.m_colorIndex,block.m_shapeIndex);
	}
	 
	char * GetElem();
	int GetColorIndex(){return m_colorIndex;}
	static void ChangBlockSize(UINT size){BLOCK_SIZE=size;}
	void Init(int colorIndex,int shapeIndex);
	void Rotate();
	CBlock();
 	void DrawWhite(CDC &dc,int x,int y);
	virtual ~CBlock();

};

#endif // !defined(AFX_BLOCK_H__803DC079_B3EE_47D6_9AF1_83C8A059332C__INCLUDED_)
